/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(name = "nivelusuario", catalog = "SIESCO", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Nivelusuario.findAll", query = "SELECT n FROM Nivelusuario n"),
    @NamedQuery(name = "Nivelusuario.findByIdnivel", query = "SELECT n FROM Nivelusuario n WHERE n.idnivel = :idnivel"),
    @NamedQuery(name = "Nivelusuario.findByNivel", query = "SELECT n FROM Nivelusuario n WHERE n.nivel = :nivel")})
public class Nivelusuario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "idnivel", nullable = false)
    private Integer idnivel;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "nivel", nullable = false, length = 15)
    private String nivel;

    public Nivelusuario() {
    }

    public Nivelusuario(Integer idnivel) {
        this.idnivel = idnivel;
    }

    public Nivelusuario(Integer idnivel, String nivel) {
        this.idnivel = idnivel;
        this.nivel = nivel;
    }

    public Integer getIdnivel() {
        return idnivel;
    }

    public void setIdnivel(Integer idnivel) {
        this.idnivel = idnivel;
    }

    public String getNivel() {
        return nivel;
    }

    public void setNivel(String nivel) {
        this.nivel = nivel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idnivel != null ? idnivel.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nivelusuario)) {
            return false;
        }
        Nivelusuario other = (Nivelusuario) object;
        if ((this.idnivel == null && other.idnivel != null) || (this.idnivel != null && !this.idnivel.equals(other.idnivel))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Nivelusuario[ idnivel=" + idnivel + " ]";
    }
    
}
